At first, some terms and their corresponding abbreviations used in the present disclosure are listed as follows:
BT: Bluetooth;
BT Controller: Bluetooth controller;
BT Host: Bluetooth upper layer module, which cooperates with a BT controller to realize BT functions;
HCI: Host Controller Interface, a standard software interface between the BT Controller and the BT Host;
HCI TRANS: HCI Transport layer, including regulations relevant to data format, retransmission, error processing, etc., in communications between a BT Controller and a BT Host;
AP: Application Processor;
DSP: Digital Signal Processor;
SBC: low complexity Sub-Band Codec;
A2DP: Advanced Audio Distribute Profile, defining protocols and processes of high quality audio distribution in an ACL channel;
ACL: Asynchronous Connection Like;
AVDTP: Audio Video Distribute Profile, residing in a transport layer;
L2CAP: Logical Link Control Adaptor Protocol, residing in a data link layer;
HCI ACL Data Packet: adapted for transmitting data between a host and a BT Controller;
UART: Universal Asynchronous Receiver/Transmitter;
PCM: a hardware interface used in audio transmission, including four signal wires, SYNC, CLK, TX and RX;
SRC: Source;
SSRC: Synchronization Source Identifier;
CID: Channel Identity;
RISC: Reduced Instruction Set Computer;
LSB: Least Significant Bit; and
MSB: Most Significant Bit.
Currently, various intelligent terminals, such as smart phones, tablet computers, etc., are configured with a function of playing audio data via Bluetooth (BT). Such a terminal can transmit data (generally including control signals and audio data packets) via BT to a playback device, such as an earphone, a speaker, etc., thus the playback device can play audio contents.
Generally, a user terminal possessing the function of playing audio data via BT (which is referred as “BT terminal” hereafter for short) at least includes an AP, a BT Controller, and a SBC module. The SBC module may be replaced by other type of coding modules with technology development. The AP at least includes HCI TRANS, HCI, L2CAP, AVDTP, and A2DP. Further, a UART interface capable of data transmission is configured between the BT Controller and the HCI TRANS in the AP.
During a process of playing an audio file via BT, functions of each layer are illustrated as follows.
By managing a state of the HCI TRANS, the UART interface can be controlled. Further, when serving as a receiver, the HCI TRANS is configured to: divide serial data from the BT Controller into frames, identify events and data from the frames, and send the identified events and data to the HCI for subsequent processing. When serving as a transmitter, the HCI TRANS is configured to: distinguish information sent from the upper HCI layer into commands and data, respectively mark the commands and the data with command/data labels and length indicators, and output the commands and the data via the UART interface. The marked labels and the length indicators are helpful for the BT Controller to implement frame division and command/data identification.
By managing a state of the HCI, the HCI TRANS can be controlled. Further, when serving as a receiver, the HCI is configured to: process the events and the data sent from the HCI transport layer according to HCI formats and protocols, reorganize the divided data, and manage a buffer. When serving as a transmitter, the HCI is configured to: divide commands and parameters/data requested by an upper layer according to a length of a controller buffer in the BT Controller, implement a HCI layer packing process according to the HCI formats, and request the HCI transport layer to send the data according to an occupancy state of the controller buffer. The occupancy state of the controller buffer is indicated by HCI number of packet complete event sent from the BT Controller.
Referring to FIG. 1, a data packet of HCI is illustrated. In the data packet, a connection handle is configured to identify an ACL connection. A PB Flag and a BC Flag are also shown. However, the PB Flag and the BC Flag are irrelative to the present disclosure and herein will not be described in detail.
The L2CAP resides in the link layer. Its functions include: connection establishing, connection closing, state managing, multiplexing, data packet dividing, data packet assembling, etc.
Referring to FIG. 2, a data packet of L2CAP is illustrated. In the data packet, the channel identifier refers to a channel identifier of a target L2CAP.
The AVDTP resides in the transport layer. Its functions include: connection opening, connection closing, state managing, signal processing, multiplexing, data packet dividing, data packet assembling, user data (e.g. A2DP SBC audio data) configuring and transmitting, etc.
Referring to FIG. 3, a data packet of AVDTP is illustrated. In the data packet, CSRC (Contributing Source) count indicates a quantity of CSRCs. PT refers to payload type. SN refers to Sequence Number which increases by 1 once a packet is sent. Timestamp generally counts in measurement of audio digital sample signal.
The A2DP is configured to manage A2DP SRC (Source), such as open, configure, initiate, pause, etc., the A2DP SRC. The A2DP may be further configured to: negotiate with an opposite terminal about SBC parameters, and control the SBC module.
The SBC is a format of the A2DP transmitting audio. The SBC module is configured to code audio data into an audio data packet in SBC format. Coding implemented by the SBC module may include at least one parameter selected from a group consisting of: a sampling frequency, a channel mode, a block length, sub-bands, an allocation mode and a Bitpool.
FIG. 4 illustrates typical code stream output rates of a SBC module.
When playing audio data via BT, connections are established by: the HCI controlling the BT Controller to establish an ACL connection with an opposite terminal, which connection corresponds to the ACL handle; and establishing a L2CAP connection, and an AVDTP signaling/AVDTP streaming according to the ACL connection, in which the L2CAP connection is identified by a local-opposite CID pair.
The A2DP implements functions of playing, pausing and exception handling through AVDTP. Specifically, configurations of SBC parameters are defined in a configure procedure. The A2DP controls the SBC (e.g., controls the configuration, initiating or closing of the SBC) according to state changes in the AVDTP process. And audio data packets in SBC format are transmitted through the AVDTP.
Referring to FIG. 5, a process of playing audio data via BT according to prior art is illustrated. In FIG. 5, arrows are used to indicate the direction of a data flow.
In prior art, audio data packets transmission requires processing in multiple layers in an AP, including a HCI transport layer, a HCI, a L2CAP layer, an AVDTP layer and an A2DP layer. And ultimately, these audio data packets are wirelessly transmitted to a playback device (e.g., a BT earphone) on the opposite side.
When playing audio data via BT, audio data packets are constantly generated and required to be processed by the aforesaid layers in the application processor. Accordingly, during the entire audio play process, the application processor is frequently occupied and thus unable to enter into a sleep mode. As a result, high power consumption will be caused.